﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleData.Infrastructure.Validation
{
	public static class ValidationExtensions
	{


		/// <summary>
		/// 
		/// </summary>
		/// <param name="result"></param>
		/// <returns></returns>
		public static bool IsValid( this IEnumerable<EntityValidationResult> result )
		{
			if ( result == null || result.Count() == 0 )
				return true;
			else
				return result.All( r => r.IsValid );
		}
	}
}
